Optimal. Leaf size=87 \[ -\frac {3 x}{8 a}-\frac {\cos (c+d x)}{a d}+\frac {\cos ^3(c+d x)}{3 a d}+\frac {3 \cos (c+d x) \sin (c+d x)}{8 a d}+\frac {\cos (c+d x) \sin ^3(c+d x)}{4 a d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 87, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 4, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.138, Rules used = {2918, 2713,
2715, 8} \begin {gather*} \frac {\cos ^3(c+d x)}{3 a d}-\frac {\cos (c+d x)}{a d}+\frac {\sin ^3(c+d x) \cos (c+d x)}{4 a d}+\frac {3 \sin (c+d x) \cos (c+d x)}{8 a d}-\frac {3 x}{8 a} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2713
Rule 2715
Rule 2918
Rubi steps
\begin {align*} \int \frac {\cos ^2(c+d x) \sin ^3(c+d x)}{a+a \sin (c+d x)} \, dx &=\frac {\int \sin ^3(c+d x) \, dx}{a}-\frac {\int \sin ^4(c+d x) \, dx}{a}\\ &=\frac {\cos (c+d x) \sin ^3(c+d x)}{4 a d}-\frac {3 \int \sin ^2(c+d x) \, dx}{4 a}-\frac {\text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,\cos (c+d x)\right )}{a d}\\ &=-\frac {\cos (c+d x)}{a d}+\frac {\cos ^3(c+d x)}{3 a d}+\frac {3 \cos (c+d x) \sin (c+d x)}{8 a d}+\frac {\cos (c+d x) \sin ^3(c+d x)}{4 a d}-\frac {3 \int 1 \, dx}{8 a}\\ &=-\frac {3 x}{8 a}-\frac {\cos (c+d x)}{a d}+\frac {\cos ^3(c+d x)}{3 a d}+\frac {3 \cos (c+d x) \sin (c+d x)}{8 a d}+\frac {\cos (c+d x) \sin ^3(c+d x)}{4 a d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(271\) vs. \(2(87)=174\).
time = 1.22, size = 271, normalized size = 3.11 \begin {gather*} \frac {24 (c-3 d x) \cos \left (\frac {c}{2}\right )-72 \cos \left (\frac {c}{2}+d x\right )-72 \cos \left (\frac {3 c}{2}+d x\right )+24 \cos \left (\frac {3 c}{2}+2 d x\right )-24 \cos \left (\frac {5 c}{2}+2 d x\right )+8 \cos \left (\frac {5 c}{2}+3 d x\right )+8 \cos \left (\frac {7 c}{2}+3 d x\right )-3 \cos \left (\frac {7 c}{2}+4 d x\right )+3 \cos \left (\frac {9 c}{2}+4 d x\right )-48 \sin \left (\frac {c}{2}\right )+24 c \sin \left (\frac {c}{2}\right )-72 d x \sin \left (\frac {c}{2}\right )+72 \sin \left (\frac {c}{2}+d x\right )-72 \sin \left (\frac {3 c}{2}+d x\right )+24 \sin \left (\frac {3 c}{2}+2 d x\right )+24 \sin \left (\frac {5 c}{2}+2 d x\right )-8 \sin \left (\frac {5 c}{2}+3 d x\right )+8 \sin \left (\frac {7 c}{2}+3 d x\right )-3 \sin \left (\frac {7 c}{2}+4 d x\right )-3 \sin \left (\frac {9 c}{2}+4 d x\right )}{192 a d \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.19, size = 116, normalized size = 1.33
method | result | size |
risch | \(-\frac {3 x}{8 a}-\frac {3 \cos \left (d x +c \right )}{4 a d}-\frac {\sin \left (4 d x +4 c \right )}{32 a d}+\frac {\cos \left (3 d x +3 c \right )}{12 a d}+\frac {\sin \left (2 d x +2 c \right )}{4 a d}\) | \(73\) |
derivativedivides | \(\frac {\frac {16 \left (-\frac {3 \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64}-\frac {11 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64}-\frac {\left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}+\frac {11 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64}-\frac {\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+\frac {3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{64}-\frac {1}{12}\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}-\frac {3 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}}{a d}\) | \(116\) |
default | \(\frac {\frac {16 \left (-\frac {3 \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64}-\frac {11 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64}-\frac {\left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}+\frac {11 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{64}-\frac {\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3}+\frac {3 \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{64}-\frac {1}{12}\right )}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}-\frac {3 \arctan \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4}}{a d}\) | \(116\) |
norman | \(\frac {\frac {3 \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}-\frac {3 x}{8 a}-\frac {3 x \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{8 a}-\frac {15 x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 a}-\frac {15 x \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 a}-\frac {15 x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 a}-\frac {15 x \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 a}-\frac {15 x \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 a}-\frac {15 x \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 a}-\frac {15 x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 a}-\frac {15 x \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 a}-\frac {3 x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 a}-\frac {3 x \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{8 a}-\frac {7}{12 a d}+\frac {3 \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 a d}+\frac {\tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{6 a d}+\frac {5 \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 a d}+\frac {\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )}{4 a d}+\frac {7 \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{2 a d}-\frac {13 \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 a d}-\frac {11 \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 a d}+\frac {7 \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 a d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5} \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}\) | \(399\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 237 vs.
\(2 (79) = 158\).
time = 0.49, size = 237, normalized size = 2.72 \begin {gather*} \frac {\frac {\frac {9 \, \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \frac {64 \, \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {33 \, \sin \left (d x + c\right )^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} - \frac {48 \, \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {33 \, \sin \left (d x + c\right )^{5}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{5}} - \frac {9 \, \sin \left (d x + c\right )^{7}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{7}} - 16}{a + \frac {4 \, a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {6 \, a \sin \left (d x + c\right )^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {4 \, a \sin \left (d x + c\right )^{6}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{6}} + \frac {a \sin \left (d x + c\right )^{8}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{8}}} - \frac {9 \, \arctan \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1}\right )}{a}}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.34, size = 58, normalized size = 0.67 \begin {gather*} \frac {8 \, \cos \left (d x + c\right )^{3} - 9 \, d x - 3 \, {\left (2 \, \cos \left (d x + c\right )^{3} - 5 \, \cos \left (d x + c\right )\right )} \sin \left (d x + c\right ) - 24 \, \cos \left (d x + c\right )}{24 \, a d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 1049 vs.
\(2 (70) = 140\).
time = 11.26, size = 1049, normalized size = 12.06 \begin {gather*} \begin {cases} - \frac {9 d x \tan ^{8}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{24 a d \tan ^{8}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{6}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 144 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 24 a d} - \frac {36 d x \tan ^{6}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{24 a d \tan ^{8}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{6}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 144 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 24 a d} - \frac {54 d x \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{24 a d \tan ^{8}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{6}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 144 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 24 a d} - \frac {36 d x \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{24 a d \tan ^{8}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{6}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 144 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 24 a d} - \frac {9 d x}{24 a d \tan ^{8}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{6}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 144 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 24 a d} - \frac {18 \tan ^{7}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{24 a d \tan ^{8}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{6}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 144 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 24 a d} - \frac {66 \tan ^{5}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{24 a d \tan ^{8}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{6}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 144 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 24 a d} - \frac {96 \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{24 a d \tan ^{8}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{6}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 144 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 24 a d} + \frac {66 \tan ^{3}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{24 a d \tan ^{8}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{6}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 144 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 24 a d} - \frac {128 \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )}}{24 a d \tan ^{8}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{6}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 144 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 24 a d} + \frac {18 \tan {\left (\frac {c}{2} + \frac {d x}{2} \right )}}{24 a d \tan ^{8}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{6}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 144 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 24 a d} - \frac {32}{24 a d \tan ^{8}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{6}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 144 a d \tan ^{4}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 96 a d \tan ^{2}{\left (\frac {c}{2} + \frac {d x}{2} \right )} + 24 a d} & \text {for}\: d \neq 0 \\\frac {x \sin ^{3}{\left (c \right )} \cos ^{2}{\left (c \right )}}{a \sin {\left (c \right )} + a} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.45, size = 114, normalized size = 1.31 \begin {gather*} -\frac {\frac {9 \, {\left (d x + c\right )}}{a} + \frac {2 \, {\left (9 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 33 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 48 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} - 33 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 64 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 9 \, \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 16\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{4} a}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.61, size = 79, normalized size = 0.91 \begin {gather*} \frac {{\cos \left (c+d\,x\right )}^3}{3\,a\,d}-\frac {\cos \left (c+d\,x\right )}{a\,d}-\frac {3\,x}{8\,a}-\frac {{\cos \left (c+d\,x\right )}^3\,\sin \left (c+d\,x\right )}{4\,a\,d}+\frac {5\,\cos \left (c+d\,x\right )\,\sin \left (c+d\,x\right )}{8\,a\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________